package com.seecen.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seecen.pojo.entity.Guide;
import com.seecen.service.GuideService;
import com.seecen.mapper.GuideMapper;
import org.springframework.stereotype.Service;

/**
* @author dell
* @description 针对表【hm_guide(导游信息表)】的数据库操作Service实现
* @createDate 2025-10-20 14:29:51
*/
@Service
public class GuideServiceImpl extends ServiceImpl<GuideMapper, Guide>
        implements GuideService{

    @Override
    public Guide getGuideBySearchType(String searchType, String searchValue) {
        LambdaQueryWrapper<Guide> queryWrapper = new LambdaQueryWrapper<>();

        switch (searchType) {
            case "phone":
                queryWrapper.eq(Guide::getGuidePhoneNumber, searchValue);
                break;
            case "license":
                queryWrapper.eq(Guide::getLicenseNumber, searchValue);
                break;
            default:
                return null;
        }

        return this.getOne(queryWrapper);
    }
}




